﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AnimalFight.Lib.Interface;
using AnimalFight.Lib.EventHandlers;

namespace AnimalFight.Lib.Data
{
    public class Snake : AnimalBase, IAttack, IDefense
    {
        public event AttackDelegate AttackEvent;
        public event DefenseDelegate DefenseEvent;

        public bool IsDefending { get; set; }

        public void Attack(EventHandlers.Animals target)
        {
            if (AttackEvent != null)
            {
                AttackEventHandler e = new AttackEventHandler
                {
                    AnimalName = this.Name,
                    AP = this.AP,
                    Target = target
                };
            }
        }

        public void Defense()
        {
            if (DefenseEvent != null)
            {
                DefenseEvent(this, new DefenseEventHandler
                    {
                        AnimalName = this.Name,
                        Target = Animals.Snake
                    });
            }
        }
    }
}
